﻿using netDxf;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Tables;
using System;
using System.Collections.Generic; 
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestDxfDocument
{
    class Class5
    {
        public static void Standard29014_3_E5(Dictionary<string, Object> data)
        {
            string path = Convert.ToString(data["path"]);



            DxfDocument dxf = new DxfDocument();
            //图层
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            Layer dimensioning = new Layer("dimensioning");    //尺寸层
            Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
            Layer center = new Layer("center") { Color = AciColor.Yellow };    //中心线
            Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
            Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
            Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
            Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
            Layer nocutting = new Layer("nocutting");    //非切削层
            Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
            Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
            Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
            Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
            Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
            Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
            Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
            Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层
                                                                           //参数

            double pi = Math.PI;

         

            Vector2 v0 = new Vector2(0, 0);
            Vector2 v1 = fun.Polar(v0, 60 * pi / 180, 5);
            Vector2 v2 = fun.Polar(v0, 0, 5);
            Vector2 v3 = fun.Polar(v1, 60 * pi / 180, 0.001);
            Vector2 v4 = fun.Polar(v1, 120 * pi / 180, 0.001);
            LwPolyline line1 = new LwPolyline();
            line1.Vertexes.Add(new LwPolylineVertex(v0));
            line1.Vertexes.Add(new LwPolylineVertex(v1));
            line1.Vertexes.Add(new LwPolylineVertex(v2));
            line1.Vertexes.Add(new LwPolylineVertex(v0));
            dxf.AddEntity(line1);
            //标注
            DimensionStyle dimensionStyle = fun.CreateDimStyle();
            dimensionStyle.ArrowSize = 1;
            dimensionStyle.DimArrow1 = DimensionArrowhead.Closedfilled;
            dimensionStyle.DimArrow2 = DimensionArrowhead.Closedfilled;
            dimensionStyle.TextHeight = 0.2;
            double offset = 10;
            Angular2LineDimension angdim1 = new Angular2LineDimension(new Line(v1, v3), new Line(v1, v4), offset, dimensionStyle);
            angdim1.UserText = "RMPX";
            dxf.AddEntity(angdim1);



           



            dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
            dxf.Save(path);
        }

        private static double distance(Vector3 pp1, Vector2 pp2)
        {
            double dist;
            dist = Math.Sqrt(Math.Pow((pp2.X - pp1.X), 2) + Math.Pow((pp2.Y - pp1.Y), 2));
            return dist;
        }
        private static double distance1(Vector2 pp1, Vector2 pp2)
        {
            double dist;
            dist = Math.Sqrt(Math.Pow((pp2.X - pp1.X), 2) + Math.Pow((pp2.Y - pp1.Y), 2));
            return dist;
        }
        private static void dimrot1(DxfDocument dxf1, Vector2 fp1, Vector2 fp2, double ang, double offset, String text, String toh, String tol)
        {
            Vector2 fp1p = fp1;
            Vector2 fp2p = fp2;
            if (fp2.Y > fp1.Y) { fp1 = fp2p; fp2 = fp1p; }

            double pi = 3.1415926535897;
            //       if (text.Contains("φ")) text = text+"  ";

            /*           double ang1,angp;
                        if (fp2.X == fp1.X)
                        {
                            if (fp2.Y > fp1.Y) ang1 = 90;
                            else ang1 = -90;
                        }
                        else
                        {
                            ang1=Math.Atan((fp2.Y-fp1.Y)/(fp2.X-fp1.X))*180/pi;
                        }
                        ang1=Math.Abs(ang1);
                        if (fp2.Y > fp1.Y) angp = 90 - ang - (90 - ang1);
                        else angp = 90 + ang - (90 - ang1);*/
            Vector2 fpp = new Vector2((fp1.X + fp2.X) / 2.0, (fp1.Y + fp2.Y) / 2.0);
            double ang1 = 0, ang2 = 0, ang3 = 0;
            if (ang > -90 && ang <= 90)
            {
                ang1 = ang; ang2 = 90 + ang; ang3 = ang2;
            }
            if (ang >= -180 && ang <= -90)
            {
                ang1 = 180 + ang; ang2 = 90 + ang; ang3 = ang2 + 180;
            }
            if (ang > 90 && ang <= 180)
            {
                ang1 = ang - 180; ang2 = ang - 270; ang3 = ang2 + 180;
            }
            Vector2 fp7p = new Vector2(fpp.X + offset * Math.Cos(ang2 * pi / 180), fpp.Y + offset * Math.Sin(ang2 * pi / 180));

            double xx = (fp7p.Y - Math.Tan(ang1 * pi / 180) * fp7p.X - fp1.Y + Math.Tan(ang2 * pi / 180) * fp1.X) / (Math.Tan(ang2 * pi / 180) - Math.Tan(ang1 * pi / 180));
            double yy = Math.Tan(ang1 * pi / 180) * xx + fp7p.Y - Math.Tan(ang1 * pi / 180) * fp7p.X;
            if (ang1 == 90.0 || ang1 == -90.0)
            {
                xx = fp7p.X;
                yy = fp1.Y;
            }
            Vector2 fp3 = new Vector2(xx, yy);

            double xx1 = (fp7p.Y - Math.Tan(ang1 * pi / 180) * fp7p.X - fp2.Y + Math.Tan(ang2 * pi / 180) * fp2.X) / (Math.Tan(ang2 * pi / 180) - Math.Tan(ang1 * pi / 180));
            double yy1 = Math.Tan(ang1 * pi / 180) * xx1 + fp7p.Y - Math.Tan(ang1 * pi / 180) * fp7p.X;
            if (ang1 == 90.0 || ang1 == -90.0)
            {
                xx1 = fp7p.X;
                yy1 = fp2.Y;
            }

            Vector2 fp4 = new Vector2(xx1, yy1);

            double lp3p4 = distance1(fp3, fp4);

            Vector2 fp5 = new Vector2(fp3.X + 2 * Math.Cos(ang2 * pi / 180), fp3.Y + 2 * Math.Sin(ang2 * pi / 180));
            Vector2 fp6 = new Vector2(fp4.X + 2 * Math.Cos(ang2 * pi / 180), fp4.Y + 2 * Math.Sin(ang2 * pi / 180));
            Vector2 fpl, fpr;
            fpl = fp3; fpr = fp4;

            if (ang >= 0 && ang <= 90)
            {
                if (fp3.X < fp4.X || fp3.Y < fp4.Y)
                {
                    fpl = fp3; fpr = fp4;
                }
                else
                {
                    fpl = fp4; fpr = fp3;
                }
            }
            if (ang > -90 && ang < 0)
            {
                if (fp3.X < fp4.X || fp3.Y > fp4.Y)
                {
                    fpl = fp3; fpr = fp4;
                }
                else
                {
                    fpl = fp4; fpr = fp3;
                }
            }
            if (ang > 90 && ang <= 180)
            {
                if (fp3.X < fp4.X || fp3.Y > fp4.Y)
                {
                    fpl = fp3; fpr = fp4;
                }
                else
                {
                    fpl = fp4; fpr = fp3;
                }
            }
            if (ang >= -180 && ang <= -90)
            {
                if (fp3.X < fp4.X || fp3.Y < fp4.Y)
                {
                    fpl = fp3; fpr = fp4;
                }
                else
                {
                    fpl = fp4; fpr = fp3;
                }
            }

            Vector2 fp7pp = new Vector2(fpl.X + 2.5 / distance1(fp3, fp4) * (fpl.X - fpr.X), fpl.Y + 2.5 / distance1(fpl, fpr) * (fpl.Y - fpr.Y));
            Vector2 fp7 = new Vector2(fp7pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos(ang2 * pi / 180), fp7pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin(ang2 * pi / 180));
            Vector2 fp8 = new Vector2(fp7pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos((ang2 + 180) * pi / 180), fp7pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin((ang2 + 180) * pi / 180));

            Vector2 fp9pp = new Vector2(fpl.X + 2.5 / distance1(fpr, fpl) * (fpr.X - fpl.X), fpl.Y + 2.5 / distance1(fpl, fpr) * (fpr.Y - fpl.Y));
            Vector2 fp9 = new Vector2(fp9pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos(ang2 * pi / 180), fp9pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin(ang2 * pi / 180));
            Vector2 fp10 = new Vector2(fp9pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos((ang2 + 180) * pi / 180), fp9pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin((ang2 + 180) * pi / 180));

            Vector2 fp11pp = new Vector2(fpr.X + 2.5 / distance1(fpl, fpr) * (fpr.X - fpl.X), fpr.Y + 2.5 / distance1(fpl, fpr) * (fpr.Y - fpl.Y));
            Vector2 fp11 = new Vector2(fp11pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos(ang2 * pi / 180), fp11pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin(ang2 * pi / 180));
            Vector2 fp12 = new Vector2(fp11pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos((ang2 + 180) * pi / 180), fp11pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin((ang2 + 180) * pi / 180));

            Vector2 fp13pp = new Vector2(fpr.X + 2.5 / distance1(fpl, fpr) * (fpl.X - fpr.X), fpr.Y + 2.5 / distance1(fpl, fpr) * (fpl.Y - fpr.Y));
            Vector2 fp13 = new Vector2(fp13pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos(ang2 * pi / 180), fp13pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin(ang2 * pi / 180));
            Vector2 fp14 = new Vector2(fp13pp.X + 2.5 * Math.Tan(10 * pi / 180) * Math.Cos((ang2 + 180) * pi / 180), fp13pp.Y + 2.5 * Math.Tan(10 * pi / 180) * Math.Sin((ang2 + 180) * pi / 180));

            Vector2 fp15 = new Vector2(fpl.X + (text.Length * 3.5 + Math.Max(tol.Length, toh.Length) * 1.5) * 0.7 / distance1(fpl, fpr) * (fpl.X - fpr.X),
                                       fpl.Y + (text.Length * 3.5 + Math.Max(tol.Length, toh.Length) * 1.5) * 0.7 / distance1(fpl, fpr) * (fpl.Y - fpr.Y));
            Vector2 fp16 = new Vector2(fpr.X + (text.Length * 3.5 + Math.Max(tol.Length, toh.Length) * 1.5) * 0.7 / distance1(fpl, fpr) * (fpr.X - fpl.X),
                                       fpr.Y + (text.Length * 3.5 + Math.Max(tol.Length, toh.Length) * 1.5) * 0.7 / distance1(fpl, fpr) * (fpr.Y - fpl.Y));

            double jl, angtext;
            //           if (ang > -90 && ang <= 90) jl = 2;
            //           else jl = -2;
            jl = 2;
            angtext = ang1;

            double sxl = 0.0;
            if (!text.Contains("(")) sxl = -4;

            double lentexttol = text.Length * 3.5 * 0.7 + Math.Max(tol.Length, toh.Length) * 1.5 * 0.7;

            Vector2 fp18 = new Vector2(fp15.X + jl * Math.Cos(ang3 * pi / 180), fp15.Y + jl * Math.Sin(ang3 * pi / 180));
            Vector2 fp21 = new Vector2(fp16.X + jl * Math.Cos(ang3 * pi / 180), fp16.Y + jl * Math.Sin(ang3 * pi / 180));
            Vector2 fp21p = new Vector2(fp21.X - (Math.Max(tol.Length, toh.Length) * 1.5 * 0.7 + sxl) * 0.5 * Math.Cos(ang1 * pi / 180), fp21.Y - (Math.Max(tol.Length, toh.Length) * 1.5 * 0.7 + sxl) * 0.5 * Math.Sin(ang1 * pi / 180));
            Vector2 fp21pp = new Vector2(fp21p.X + (Math.Max(tol.Length, toh.Length) * 0.7 * 1.5 + 4) * 0.5 * Math.Cos(ang1 * pi / 180), fp21p.Y + (Math.Max(tol.Length, toh.Length) * 0.7 * 1.5 + 4) * 0.5 * Math.Sin(ang1 * pi / 180));

            Vector2 fp19 = new Vector2(fp18.X + (lentexttol + 6 + sxl) * 0.5 * Math.Cos(ang1 * pi / 180), fp18.Y + (lentexttol + 6 + sxl) * 0.5 * Math.Sin(ang1 * pi / 180));
            Vector2 fp19p = new Vector2(fp19.X + Math.Max(tol.Length, toh.Length) * 1.5 * 0.7 * Math.Cos(ang1 * pi / 180), fp19.Y + Math.Max(tol.Length, toh.Length) * 1.5 * 0.7 * Math.Sin(ang1 * pi / 180));
            Vector2 fp20 = new Vector2(fp21.X - (lentexttol - 4.5) * Math.Cos(ang1 * pi / 180), fp21.Y - (lentexttol - 4.5) * Math.Sin(ang1 * pi / 180));

            Vector2 fp17 = new Vector2(fp7p.X + jl * Math.Cos(ang3 * pi / 180), fp7p.Y + jl * Math.Sin(ang3 * pi / 180));


            Vector2 fp22 = new Vector2(fp17.X +
                lentexttol * 0.5 * 0.5 / distance1(fpl, fpr) * (fpl.X - fpr.X), fp17.Y + lentexttol * 0.5 * 0.5 / distance1(fpl, fpr) * (fpl.Y - fpr.Y));
            Vector2 fp23 = new Vector2(fp17.X + (lentexttol * 0.5 + 2 + sxl) * 0.5 / distance1(fpl, fpr) * (fpr.X - fpl.X), fp17.Y + (lentexttol * 0.5 + 2 + sxl) * 0.5 / distance1(fpl, fpr) * (fpr.Y - fpl.Y));
            Vector2 fp23p = new Vector2(fp17.X + (lentexttol - 1) * 0.5 / distance1(fpl, fpr) * (fpr.X - fpl.X), fp17.Y + (lentexttol - 1) * 0.5 / distance1(fpl, fpr) * (fpr.Y - fpl.Y));

            Vector2 fp24 = new Vector2(fp19.X + jl * Math.Cos(ang3 * pi / 180), fp19.Y + jl * Math.Sin(ang3 * pi / 180));
            Vector2 fp25 = new Vector2(fp23.X + jl * Math.Cos(ang3 * pi / 180), fp23.Y + jl * Math.Sin(ang3 * pi / 180));
            Vector2 fp26 = new Vector2(fp21p.X + jl * Math.Cos(ang3 * pi / 180), fp21p.Y + jl * Math.Sin(ang3 * pi / 180));

            if (lentexttol < lp3p4)
            {
                Text text1 = new Text(text, fp22, 3.5, angtext);
                //                    zhc = "context.fillText(\"" + text + "\"," + fp22.X + "," + fp22.Y + ");";
                //                    sw.WriteLine(zhc);


                text1.WidthFactor = 0.7;
                Text text2 = new Text(tol, fp23, 1.5, angtext);
                //                    zhc = "context.fillText(\"" + tol + "\"," + fp23.X + "," + fp23.Y + ");";
                //                    sw.WriteLine(zhc);


                text2.WidthFactor = 0.7;
                Text text3 = new Text(toh, fp25, 1.5, angtext);
                //                    zhc = "context.fillText(\"" + toh + "\"," + fp25.X + "," + fp25.Y + ");";
                //                    sw.WriteLine(zhc);


                text3.WidthFactor = 0.7;
                dxf1.AddEntity(new EntityObject[] { text1, text2, text3 });
                if (text.Contains("("))
                {
                    Text text4 = new Text(")", fp23p, 3.5, angtext);
                    //                        zhc = "context.fillText(\"" + ")" + "\"," + fp23p.X + "," + fp23p.Y + ");";
                    //                        sw.WriteLine(zhc);


                    text4.WidthFactor = 0.7;
                    dxf1.AddEntity(new EntityObject[] { text4 });
                }

                Solid sd1 = new Solid(fpl, fp9, fp10);


                Solid sd2 = new Solid(fpr, fp13, fp14);


                dxf1.AddEntity(new EntityObject[] { sd1, sd2 });

            }
        }
        /*
        Line line00 = new Line(v, v);
        line00.Layer = contour;
        line00.Lineweight = Lineweight.W50;
        dxf.AddEntity(line00);



        Line line00 = new Line(v, v);
        line00.Layer = refin;
        line00.Lineweight = Lineweight.W35;
        line00.Linetype = Linetype.Dashed;
        dxf.AddEntity(line00);


        Line line00 = new Line(v, v);
        line00.Lineweight = Lineweight.W25;
        line00.Layer = additionalline;
        dxf.AddEntity(line00);

        Line line00 = new Line(v, v);
        line00.Layer = centre;
        line00.Lineweight = Lineweight.W25;
        line00.Linetype = Linetype.DashDot;
        dxf.AddEntity(line00);

         Circle circle00 = new Circle(v0, 4);
         circle00.Layer = contour;
         circle00.Lineweight = Lineweight.W50;
         dxf.AddEntity(circle00);
         

         Console.WriteLine(90 - Math.Atan((v15.X - v2.X) / (v03.Y - v15.Y)) * 180 / pi);//监控

             Ellipse entity = new Ellipse
            {
                Center = new Vector3(0, 0, 0),
                MajorAxis = 10,
                MinorAxis = 5,
                StartAngle = 40,
                EndAngle = -40,
            };
            dxf.AddEntity(entity);


        
            Ellipse ellipse00 = new Ellipse(new Vector2(0, 0), 10, 5);//椭圆
            ellipse00.Rotation = 90;

            ellipse00.Layer = contour;
            ellipse00.Lineweight = Lineweight.W50;
            dxf.AddEntity(ellipse00);


            Arc arc = new Arc(c1, 5, -45, 45);//圆弧
            arc.Linetype = Linetype.ByLayer;
            arc.Lineweight = Lineweight.W50;
            arc.Color = AciColor.Cyan;
            dxf.AddEntity(arc);


            LwPolyline Arc00 = new LwPolyline();
            Arc00.Vertexes.Add(new LwPolylineVertex(v0));
            Arc00.Vertexes.Add(new LwPolylineVertex(v0));
            Arc00.Vertexes[0].Bulge = Math.Tan(-104 * pi / 180 / 4);
            Arc00.Lineweight = Lineweight.W50;
            Arc00.Layer = contour;
            dxf.AddEntity(Arc00);




            LwPolyline line00 = new LwPolyline();
            line00.Vertexes.Add(new LwPolylineVertex(v8));
            line00.Vertexes.Add(new LwPolylineVertex(v6));
            line00.Vertexes.Add(new LwPolylineVertex(v7));
            line00.Vertexes[1].Bulge = Math.Tan(90 * pi / 180 / 4);
            line00.Vertexes.Add(new LwPolylineVertex(v9));
            line00.Layer = contour;
            line00.Lineweight = Lineweight.W50;
            dxf.AddEntity(line00);

        
            string[] s = Milling_cutter.MatchData("A2.5/6.3或B2.5/10");
            Console.WriteLine(s[0]);
            Console.WriteLine(s[1]);
            Console.WriteLine(s[2]);


         List<Vector3> points00 = new List<Vector3>
           {

                new Vector3(v1.X,v1.Y, 0),
            };

            Spline spline00 = new Spline(points00);
            spline00.Layer = contour;
            DxfDocument doc00 = new DxfDocument();
            dxf.AddEntity(spline00);

        //样条曲线
            var s1 = Pus.TwoPointsSpline(d9, d2p, 7, 3);
            s1.Layer = hatching;
            dxf.AddEntity(s1);

            Vector2 v0 = new Vector2(0,0);
            Vector2 v1 = fun.Polar(v0, 90 * pi / 180, 3.5);
            Vector2 v2 = fun.Polar(v1, 0, 7);
            Vector2 v3 = fun.Polar(v2, 0, 14);
            Vector2 v4 = fun.Polar(v3, 0, 7);
            Vector2 v5 = fun.Polar(v4, 0, 3.5);
            Vector2 v6 = fun.Polar(v5, 0, 7);
            Vector2 v7 = fun.Polar(v6, 0, 7);
            Vector2 v8 = new Vector2(v7.X + 3.5, v0.Y);
            Vector2 v9 = fun.Polar(v7, -90 * pi / 180, 7);
            Vector2 v10 = fun.Polar(v9, pi, 7);
            Vector2 v11 = fun.Polar(v10, pi, 7);
            Vector2 v12 = fun.Polar(v11, pi, 3.5); 
            Vector2 v13 = fun.Polar(v12, pi, 7);
            Vector2 v14 = fun.Polar(v13, pi, 14);
            Vector2 v15 = fun.Polar(v14, pi, 7);
            Vector2 v16 = new Vector2(v12.X, v0.Y);
                  
            LwPolyline line00 = new LwPolyline();
            line00.Vertexes.Add(new LwPolylineVertex(v1));
            line00.Vertexes.Add(new LwPolylineVertex(v4));
            line00.Vertexes.Add(new LwPolylineVertex(v12));
            line00.Vertexes.Add(new LwPolylineVertex(v15));
            line00.Vertexes.Add(new LwPolylineVertex(v1));
            dxf.AddEntity(line00);
            LwPolyline line00 = new LwPolyline();
            line00.Vertexes.Add(new LwPolylineVertex(v16));
            line00.Vertexes.Add(new LwPolylineVertex(v5));
            line00.Vertexes.Add(new LwPolylineVertex(v7));
            line00.Vertexes.Add(new LwPolylineVertex(v8));
            line00.Vertexes.Add(new LwPolylineVertex(v9));
            line00.Vertexes.Add(new LwPolylineVertex(v11));
            line00.Vertexes.Add(new LwPolylineVertex(v16));
            dxf.AddEntity(line00);
            Line line00 = new Line(v2, v14);
            dxf.AddEntity(line00);
            Line line00 = new Line(v3, v13);
            dxf.AddEntity(line00);
            Line line00 = new Line(v5, v11);
            dxf.AddEntity(line00);
            Line line00 = new Line(v6, v10);
            dxf.AddEntity(line00);
            Line line00 = new Line(v7, v9);
            dxf.AddEntity(line00);

            fun.xwgcfh(dxf, new Vector2(v15.X + 3.5, v15.Y + 3.5), "pxd");
            fun.text(dxf, new Vector2(v15.X + 9 + 2.5, v15.Y + 2), 3, "0.1");
            fun.text(dxf, new Vector2(v15.X + 9 + 14.5, v15.Y + 2), 3, "A");
            fun.xwgcfh(dxf, new Vector2(v15.X + 3.5 + 31.5, v15.Y + 3.5), "czd");
            fun.text(dxf, new Vector2(v15.X + 9 + 14.5 + 17.5, v15.Y + 2), 3, "B");

        */







        /*public static void Standard16460_1(Dictionary<string, Object> data)
         {
             DxfDocument dxf = new DxfDocument();
             //图层
             Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
             Layer dimensioning = new Layer("dimensioning");    //尺寸层
             Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
             Layer centre = new Layer("centre") { Color = AciColor.Yellow };    //中心线
             Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
             Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
             Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
             Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
             Layer nocutting = new Layer("nocutting");    //非切削层
             Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
             Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
             Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
             Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
             Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
             Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
             Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
             Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层
                                                                            //参数
             double pi = Math.PI;
             string path = Convert.ToString(data["path"]);
             //坐标
             Vector2 v0 = new Vector2(0, 0);


       


            




             dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
             dxf.Save(path);
         }
         */


        // ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ























































    }
}
